import Http, {HttpParamsProps, ReqProps} from "@/common/http";
import {BaseEntity} from "@/common/httptypes";

//后期需整改数据-没用的删掉
export type SysAnnounceEntity = {
  content: string
  id: string
  title?: string
  deptId?: string
  endTime?: string
  startTime?: string
  types?: string[]
} & BaseEntity


class SysAnnounce {
    RowKey = "id"
    EDIT = "noticePageEdit"
    ADD = "noticePageAdd"
    DEL = "noticePageDelete"
    
    MAPPING = {noticePageEdit: "编辑通知", noticePageAdd: "新增通知"}


    selectTablePage(props: HttpParamsProps): Promise<Response> {
        return Http.get("/announce/select", props)
    }

    doEdit(props: ReqProps<void>) {
        Http.doPost("/announce/updateById", props)
    }
    doSave(props: ReqProps<void>) {
        Http.doPost("/announce/save", props)
    }

    delete(props: ReqProps<void>) {
        Http.doDelete("/announce/deleteById", props)
    }

}

// eslint-disable-next-line import/no-anonymous-default-export
export default new SysAnnounce()